#define _CRT_SECURE_NO_WARNINGS 1

int removeDuplicates(int* nums, int numsSize) {
    int dest = 2;
    int src = 2;
    if (numsSize <= 2)
    {
        return numsSize;
    }
    while (src < numsSize)
    {
        if (nums[src] != nums[dest - 2])
        {
            nums[dest] = nums[src];
            dest++;
        }
        src++;
    }
    return dest;
}